﻿#include "PhysShape.h"
#include "PhysXObj.h"

_NAMESPACE_BEGIN

/// 物理地形描述结构体
struct Terrain_Desc:public Shape_Desc
{
	NxVec3 pos;
	NxVec3 size;
	UINT	nbColumns;
	UINT	nbRows;
	float	width;
	float	height;
	string nameHeightmap;
	Terrain_Desc(){}
};	

/// 物理地形形状类
class TerrainShape:public PhysXPrimitive
{
public:
	TerrainShape(){}
	~TerrainShape(){}
	void Create(const Terrain_Desc& desc,NxActorDesc& actorDesc,NxActor* pActor);
	void SetShapePtr(NxShape* p);
	typedef Terrain_Desc DescType;
protected:
	NxActor*			gHeightField;
private:
	BYTE				*m_pHeightData;				//	高度图数据指针
	NxVec3				terrainSize;
	UINT				nRows;
	UINT				nColumns;
};

_NAMESPACE_END